home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.text;
-
- import java.io.IOException;
- import java.io.ObjectInputStream;
- import java.io.ObjectOutputStream;
- import java.io.Serializable;
- import java.util.Enumeration;
- import javax.swing.event.ChangeEvent;
- import javax.swing.event.ChangeListener;
- import javax.swing.event.EventListenerList;
-
- public class StyleContext$NamedStyle implements Style, Serializable {
- // $FF: synthetic field
- private final StyleContext this$0;
- protected EventListenerList listenerList;
- protected transient ChangeEvent changeEvent;
- private transient AttributeSet attributes;
-
- public StyleContext$NamedStyle(StyleContext var1) {
- this.this$0 = var1;
- this.listenerList = new EventListenerList();
- this.changeEvent = null;
- this.attributes = var1.getEmptySet();
- }
-
- public StyleContext$NamedStyle(StyleContext var1, String var2, Style var3) {
- this.this$0 = var1;
- this.listenerList = new EventListenerList();
- this.changeEvent = null;
- this.attributes = var1.getEmptySet();
- if (var2 != null) {
- this.setName(var2);
- }
-
- if (var3 != null) {
- this.setResolveParent(var3);
- }
-
- }
-
- public StyleContext$NamedStyle(StyleContext var1, Style var2) {
- this(var1, (String)null, var2);
- }
-
- public void addAttribute(Object var1, Object var2) {
- StyleContext var3 = this.this$0;
- this.attributes = var3.addAttribute(this.attributes, var1, var2);
- this.fireStateChanged();
- }
-
- public void addAttributes(AttributeSet var1) {
- StyleContext var2 = this.this$0;
- this.attributes = var2.addAttributes(this.attributes, var1);
- this.fireStateChanged();
- }
-
- public void addChangeListener(ChangeListener var1) {
- this.listenerList.add(StyleContext.class$javax$swing$event$ChangeListener != null ? StyleContext.class$javax$swing$event$ChangeListener : (StyleContext.class$javax$swing$event$ChangeListener = StyleContext.class$("javax.swing.event.ChangeListener")), var1);
- }
-
- public boolean containsAttribute(Object var1, Object var2) {
- return this.attributes.containsAttribute(var1, var2);
- }
-
- public boolean containsAttributes(AttributeSet var1) {
- return this.attributes.containsAttributes(var1);
- }
-
- public AttributeSet copyAttributes() {
- StyleContext$NamedStyle var1 = new StyleContext$NamedStyle(this.this$0);
- var1.attributes = this.attributes.copyAttributes();
- return var1;
- }
-
- protected void fireStateChanged() {
- Object[] var1 = this.listenerList.getListenerList();
-
- for(int var2 = var1.length - 2; var2 >= 0; var2 -= 2) {
- if (var1[var2] == (StyleContext.class$javax$swing$event$ChangeListener != null ? StyleContext.class$javax$swing$event$ChangeListener : (StyleContext.class$javax$swing$event$ChangeListener = StyleContext.class$("javax.swing.event.ChangeListener")))) {
- if (this.changeEvent == null) {
- this.changeEvent = new ChangeEvent(this);
- }
-
- ((ChangeListener)var1[var2 + 1]).stateChanged(this.changeEvent);
- }
- }
-
- }
-
- public Object getAttribute(Object var1) {
- return this.attributes.getAttribute(var1);
- }
-
- public int getAttributeCount() {
- return this.attributes.getAttributeCount();
- }
-
- public Enumeration getAttributeNames() {
- return this.attributes.getAttributeNames();
- }
-
- public String getName() {
- return this.isDefined(StyleConstants.NameAttribute) ? (String)this.getAttribute(StyleConstants.NameAttribute) : null;
- }
-
- public AttributeSet getResolveParent() {
- return this.attributes.getResolveParent();
- }
-
- public boolean isDefined(Object var1) {
- return this.attributes.isDefined(var1);
- }
-
- public boolean isEqual(AttributeSet var1) {
- return this.attributes.isEqual(var1);
- }
-
- private void readObject(ObjectInputStream var1) throws ClassNotFoundException, IOException {
- var1.defaultReadObject();
- this.attributes = SimpleAttributeSet.EMPTY;
- StyleContext.readAttributeSet(var1, this);
- }
-
- public void removeAttribute(Object var1) {
- StyleContext var2 = this.this$0;
- this.attributes = var2.removeAttribute(this.attributes, var1);
- this.fireStateChanged();
- }
-
- public void removeAttributes(Enumeration var1) {
- StyleContext var2 = this.this$0;
- this.attributes = var2.removeAttributes(this.attributes, var1);
- this.fireStateChanged();
- }
-
- public void removeAttributes(AttributeSet var1) {
- StyleContext var2 = this.this$0;
- if (var1 == this) {
- this.attributes = var2.getEmptySet();
- } else {
- this.attributes = var2.removeAttributes(this.attributes, var1);
- }
-
- this.fireStateChanged();
- }
-
- public void removeChangeListener(ChangeListener var1) {
- this.listenerList.remove(StyleContext.class$javax$swing$event$ChangeListener != null ? StyleContext.class$javax$swing$event$ChangeListener : (StyleContext.class$javax$swing$event$ChangeListener = StyleContext.class$("javax.swing.event.ChangeListener")), var1);
- }
-
- public void setName(String var1) {
- if (var1 != null) {
- this.addAttribute(StyleConstants.NameAttribute, var1);
- }
-
- }
-
- public void setResolveParent(AttributeSet var1) {
- if (var1 != null) {
- this.addAttribute(StyleConstants.ResolveAttribute, var1);
- } else {
- this.removeAttribute(StyleConstants.ResolveAttribute);
- }
-
- }
-
- public String toString() {
- return "NamedStyle:" + this.getName() + " " + this.attributes;
- }
-
- private void writeObject(ObjectOutputStream var1) throws IOException {
- var1.defaultWriteObject();
- StyleContext.writeAttributeSet(var1, this.attributes);
- }
- }
-